<template>
	<view class="flex-col homepage">
		<view class="wz" @click="wztz">
			<u-icon name="map-fill"></u-icon>
			<view class="wz1">
				<view v-model="ccc">
					<view v-if="ccc.communityName==null">请选择小区位置后展示社区活动</view>
					<view style="color: brown;" v-if="ccc.communityName!=null">{{ccc.communityName}}</view>
				</view>
			</view>
		</view>
		<view class="box1">
			<swiper autoplay style="margin-bottom:30px;">
				<swiper-item>
					<image src="../img/1.png" style="width:100%; height:120px;"></image>
				</swiper-item>
				<swiper-item>
					<image src="../img/2.png" style="width:100%; height:120px;"></image>
				</swiper-item>
			</swiper>
		</view>
		<view class="gd" @click="tz1">
			<u-notice-bar style="background: #e9e9eb;" :text="text1" speed="100"></u-notice-bar>
		</view>
		<view class="flex-row wrapper">
			<view class="dage">
				<view class="wraper-col" @click="sjkm">
					<view class="quan">
						<view class="xq">
							<u-icon name="lock" size="45px" labelPos="left:10rpx;"></u-icon>
						</view>
					</view>
				</view>
				<view class="size">手机开门</view>
			</view>
			<view class="dage">
				<view class="wraper-col-two" @click="Lifepaycost">
					<view class="quan">
						<view class="xq"><strong></strong>
							<u-icon name="rmb-circle" size="45px" labelPos="left:10rpx;"></u-icon>
						</view>
					</view>
				</view>
				<view class="size">生活缴费</view>
			</view>
			<view class="dage" @click="maintenance">
				<view class="wraper-col-three">
					<view class="quan">
						<view class="xq">
							<u-icon name="server-fill" size="45px" labelPos="left:10rpx;"></u-icon>
						</view>
					</view>
				</view>
				<view class="size">维修上报</view>
			</view>
			<view class="dage" @click="fkyq()">
				<view class="wraper-col-four" >
					<view class="quan">
						<view class="xq">
							<u-icon name="plus-people-fill" size="45px" labelPos="left:10rpx;"></u-icon>
						</view>
					</view>
				</view>
				<view class="size">访客邀请</view>
			</view>
		</view>
		<view class="wrapper-two">
			<image src="../img/u1.png" style="width:100%; height:100px;"></image>

		</view>
		<view class="flex-row wrapper-three">
			<view class="flex-row wraper-col-five">
				<view class="u-line-3 text"></view>
				<view class="box"></view>
				<view class="u-line-1 text-two">社区活动</view>
			</view>
			<view class="section" @click="goActivityAll()">查看全部 ></view>
		</view>
		<view class="flex-row wrapper-four" v-for="(j,index) in ActivityList" :key="index" @click="goto(j)">
			<view class="wraper-col-six"></view>
			<view class="flex-col flex-row wraper-col-seven">
				<view class="u-line-2 text-three">{{j.activityTheme}}</view>
				<view class="u-line-1 text-four">物业服务中心 {{j.createTime}}</view>
			</view>
		</view>

		<view class="dbbox">
			<view>
				<u-icon class="dibu" name="home" :size="30" label="首页" :label-size="16" label-pos="bottom"></u-icon>
				<u-icon class="dibu" name="home" @click="tz()" :size="30" label="服务" :label-size="16"
					label-pos="bottom"></u-icon>
				<u-icon class="dibu" name="home" @click="tzwod()" :size="30" label="我的" :label-size="16"
					label-pos="bottom"></u-icon>
			</view>
		</view>

	</view>
</template>
<script>
	export default {
		data() {
			return {
				text1: '有一条紧急通知,请点击进入查看详情',
				ccc: {},
				ActivityList: {},
				user: {},
				ActivityList1:{}
			}
		},
		onLoad(params) {
			this.ccc = JSON.parse(params.j)
			this.ListAll(this.ccc)
			uni.setStorageSync('wz',this.ccc.communityId)
		},
		methods: {
			tz() {
				uni.navigateTo({
					url: '../wjx/service',
				 success: function(res) {
						console.log(res)
					}
				})
			},
			tzwod() {
				uni.navigateTo({
					url: '../wjx/Myprofile',
				 success: function(res) {
				 	console.log(res)
					}
				})
			},
			goto(j) {
				uni.navigateTo({
					url: '/pages/gwb/Activity?j=' + JSON.stringify(j)
				})
			},
			goActivityAll() {
				var j = this.ccc.communityId
				
				uni.navigateTo({
					url: '/pages/gwb/ActivityAll?j=' + j
				})
			},
			ListAll(ccc) {
				this.user = uni.getStorageSync('user')

				this.$axios({
					url: 'serverwg/gwb/GwbActivity',
					data: {
						id: ccc.communityId,
					},
					method: 'GET',
					success: (res) => {
						this.ActivityList = res.data.data.CommunityList1
					}
				})
			},
			tz1() {
				this.$axios({
					url: 'serverwg/gwb/All1',
					data: {
						id: 1,
					},
					method: 'GET',
					success: (res) => {
						this.ActivityList1 = res.data.data.CommunityList1
						uni.navigateTo({
							url: '/pages/gwb/tz?j=' + JSON.stringify(this.ActivityList1[0])
			
						})
					}
				})
				
			},
			sjkm() {
				uni.showModal({
					content: '此功能尚未开发',
					showCancel: false
				});
			},
			Lifepaycost() {
				uni.navigateTo({
					url: '/pages/gwb/Lifepaycost'
				})
			},
			wztz() {
				uni.navigateTo({
					url: '/pages/gwb/Community'
				})
			},
			maintenance() {
				uni.navigateTo({
					url: '/pages/gwb/maintenance'
				})
			},
			fkyq(){
				uni.navigateTo({
					url: '/pages/wjx/Invitevisitors'
				})
			}

		}
	}
</script>
<style lang="scss" scoped>
	/** 全局样式-开始,建议放在公共css样式文件中,比如common.css 或app.vue文件 */

	html,
	body {
		margin: 0;
		width: 100%;
		height: 100%;
		font-size: 16px
	}

	.dbbox {
		position: fixed;
		width: 1200rpx;
		margin-left: -18px;
		bottom: 0px;
		background: #dbf1e1;
	}

	.dibu {
		float: left;
		margin-left: 70px;
	}

	.wz {
		width: 500rpx;
		margin-top: 20rpx;
		margin-bottom: 70rpx;
		height: 40rpx;

	}

	.wz1 {
		position: relative;
		top: -38rpx;
		left: 50rpx;
		color: #82848a;
	}

	.quan {
		width: 111rpx;
		height: 111rpx;
		border-radius: 40rpx;
		background-color: #a0cfff;
		margin: 16rpx auto;
	}

	.xq {
		width: 111rpx;
		height: 51rpx;
		top: 8rpx;
	}

	.gd {
		margin-top: -50rpx;
		width: 680rpx;
		margin-bottom: 20rpx;
	}

	.box1 {
		width: 690rpx;
		margin: -60rpx 12rpx 0 0;
		height: 300rpx;
	}

	view,
	text,
	image {
		position: relative;
		box-sizing: border-box;
		flex-shrink: 0;
	}

	.flex-col {
		display: flex;
		align-items: flex-start;
		flex-direction: column;
	}

	.flex-row {
		display: flex;
		align-items: flex-start;
	}

	.flex-col .flex-row {
		width: 100%
	}

	/** 全局样式-结束*/
	.homepage {
		padding: 0rpx 0rpx 500rpx 32rpx;
		border-color: rgba(210, 210, 210, 1);
		font-weight: 500;
		background: #dbf1e1;

		.swiper {
			width: 670rpx;
			height: 288rpx;
			margin: 0rpx 0rpx 26rpx 8rpx;
		}

		.noticeBar {
			width: 676rpx;
			margin: 0rpx 0rpx 40rpx 6rpx;
		}

		.dage {
			width: 144rpx;
			height: 204rpx;

		}

		.size {
			text-align: center;
			margin-top: 15rpx;
		}

		.wrapper {
			width: 676rpx;
			justify-content: space-between;
			margin-bottom: 35rpx;

			.wraper-col {
				width: 144rpx;
				height: 144rpx;
				border-width: 2rpx;
				border-style: solid;
				border-color: rgba(210, 210, 210, 1);
				border-radius: 40rpx;
			}

			.wraper-col-two {
				width: 144rpx;
				height: 144rpx;
				border-width: 2rpx;
				border-style: solid;
				border-color: rgba(210, 210, 210, 1);
				border-radius: 40rpx;
			}

			.wraper-col-three {
				width: 144rpx;
				height: 144rpx;
				border-width: 2rpx;
				border-style: solid;
				border-color: rgba(210, 210, 210, 1);
				border-radius: 40rpx;
			}

			.wraper-col-four {
				width: 144rpx;
				height: 144rpx;
				border-width: 2rpx;
				border-style: solid;
				border-color: rgba(204, 204, 204, 1);
				border-radius: 40rpx;
			}
		}

		.wrapper-two {
			width: 682rpx;
			height: 188rpx;
			margin-bottom: 30rpx;
		}

		.wrapper-three {
			width: 660rpx;
			justify-content: space-between;
			margin-bottom: 40rpx;

			.wraper-col-five {
				width: 164rpx;

				.text {
					width: 162rpx;
					font-size: 26rpx;
				}

				.box {
					width: 16rpx;
					height: 44rpx;
					border-radius: 40rpx;
					top: 22rpx;
					left: 6rpx;
					background: rgba(39, 99, 208, 1);
					position: absolute;
				}

				.text-two {
					width: 174rpx;
					top: 22rpx;
					left: 34rpx;
					font-size: 34rpx;
					position: absolute;
					font-weight: 500;
				}
			}

			.section {
				width: 156rpx;
				height: 38rpx;
				margin-top: 30rpx;
				color: darkgray;
			}
		}

		.wrapper-four {
			width: 682rpx;
			justify-content: space-between;
			margin: 0rpx 0rpx 20rpx 6rpx;
			padding: 38rpx 0rpx 34rpx 38rpx;
			border: 1rpx solid gainsboro;

			.wraper-col-six {
				width: 244rpx;
				height: 188rpx;
				background: #a0cfff;
			}

			.wraper-col-seven {
				width: 364rpx;
				margin-top: 5rpx;

				.text-three {
					width: 314rpx;
					margin-bottom: 40rpx;
					font-size: 30rpx;
				}

				.text-four {
					width: 100%;
					font-size: 20rpx;
					color: rgba(156, 151, 151, 1);
				}
			}
		}

		.wrapper-five {
			width: 682rpx;
			justify-content: space-between;
			margin-left: 6rpx;
			padding: 38rpx 0rpx 34rpx 38rpx;
			border: 1rpx solid gainsboro;

			.wraper-col-eight {
				width: 244rpx;
				height: 178rpx;
				background: #a0cfff;
			}

			.wraper-col-nine {
				width: 364rpx;
				margin-top: 5rpx;

				.text-five {
					width: 314rpx;
					margin-bottom: 40rpx;
					font-size: 30rpx;
				}

				.text-six {
					width: 100%;
					font-size: 20rpx;
					color: rgba(156, 151, 151, 1);
				}
			}
		}

		.wrapper-six {
			width: 682rpx;
			justify-content: space-between;
			padding: 38rpx 0rpx 34rpx 38rpx;
			border-width: 2rpx;
			border-style: solid;
			border-color: rgba(204, 204, 204, 1);
			bottom: -74rpx;
			left: 34rpx;
			position: absolute;

			.wraper-col-ten {
				width: 244rpx;
				height: 178rpx;
				border-width: 4rpx;
				border-style: solid;
				border-color: rgba(238, 238, 238, 1);
			}

			.wraper-col-eleven {
				width: 364rpx;
				margin-top: 16rpx;

				.text-seven {
					width: 314rpx;
					margin-bottom: 56rpx;
					font-size: 30rpx;
				}

				.text-eight {
					width: 100%;
					font-size: 20rpx;
					color: rgba(156, 151, 151, 1);
				}
			}
		}
	}
</style>
